package com.gskj.eduservice.client;

import com.gskj.commonutils.ResultJson;
import com.gskj.eduservice.client.impl.VodClientImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author :CodingFarmer_码农  Connor(康纳)_郭
 * @date : 16:10 20.5.19
 * @Company : http://www.gskj.com
 * @Version : 1.0
 */

// name :指定要调用的 微服务名称。必须已经在nacos中注册过的,
// fallback指: 定当掉调用远程接口出错时，直接调用其接口的实现类的对应的方法
@FeignClient(name = "service-vod", fallback = VodClientImpl.class)
@Component
public interface VodClient {

    // 定义要调用的方法的url
    @DeleteMapping("/eduvod/video/remove/aliyun/video/{id}") // url路径为 vodController中的完全路径
    public ResultJson removeAliyunVideo(@PathVariable("id") String id);


    /***
     * 根据ids 批量删除多个 视频
     *
     * @param videoIdList
     * @return
     */
    @DeleteMapping("/eduvod/video/remove/batch/aliyun/video/{ids}")
    public ResultJson removeBatchVideoByIds(@RequestParam(value = "ids") List<String> videoIdList);

}

